﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft;
using Newtonsoft.Json;

namespace WindowsFormsApplication1
{
    public class JsonToMsg 
    {
        public static List<Message> J2M(string json)
        {

            var messages = JsonConvert.DeserializeObject<IDictionary<string, List<Message>>>(json);
            List<Message> mList = new List<Message>();
            for (int i = 0; i < messages["messages"].Count; i++)
            {
                mList.Add(messages["messages"][i]);
            }


            return mList;
        }

        public static List<Room> GetRoomUser(string json)
        {
            Room roomDetail = (Room)JsonConvert.DeserializeObject(json);


            return null;
        }
    }
}
